package capricornus.actor.attribute
{
	import capricornus.actor.events.ActorAttributeEvent;

	public class ActorMovableAttribute extends ActorAttribute
	{
		/**
		 * 跟踪的有效距离；
		 * 指跟追踪物多远可停下的距离 
		 * 注：这个范围包括了_hurtValideLen的长度
		 */		
		private var _trackValideLen:int = 80;
		/**
		 * 有效攻击距离
		 * 注：这个范围包括了_hurtValideLen的长度
		 */		
		private var _attackValidelen:int = 120;
		/**
		 * 有效受击距离
		 * 注：其实就是actor的体积多大，横截面半径 
		 */		
		private var _hurtValideLen:int = 40;
		/**
		 * 最大追踪范围；
		 * 比如怪物跟人超过这个距离的时候，怪物就不追踪了 
		 */		
		private var _maxTrackLen:int = 400;
		
		public function ActorMovableAttribute()
		{
			super();
		}
		
		public function get trackValideLen():int
		{
			return _trackValideLen;
		}
		
		public function get attackValidelen():int
		{
			return _attackValidelen;
		}
		
		public function get hurtValideLen():int
		{
			return _hurtValideLen;
		}
		
		public function get maxTrackLen():int
		{
			return _maxTrackLen;
		}
		
		public function setTrackValideLen( value:int, dispatchEvent:Boolean=true ):void
		{
			if( _trackValideLen != value )
			{
				_trackValideLen = value;
			}
		}
		
		public function setAttackValidelen( value:int, dispatchEvent:Boolean=true ):void
		{
			if( _attackValidelen != value )
			{
				_attackValidelen = value;
				if( dispatchEvent ) this.dispatchEvent( new ActorAttributeEvent( ActorAttributeEvent.ATTACK_VALIDE_LEN_CHANGED ) );
			}
		}
		
		public function setHurtValideLen( value:int, dispatchEvent:Boolean=true ):void
		{
			if( _hurtValideLen != value )
			{
				_hurtValideLen = value;
			}
		}
		
		public function setMaxTrackLen( value:int, dispatchEvent:Boolean=true ):void
		{
			if( _maxTrackLen != value )
			{
				_maxTrackLen = value;
			}
		}
	}
}